﻿@using Microsoft.AspNetCore.Mvc.ModelBinding
@{
  Layout = null;
}

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>错误</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
</head>
<body>
  @if (!this.ViewContext.ModelState.IsValid)
  {
    <ul>
      @foreach (var (key, entry) in this.ViewContext.ModelState)
      {
        if (entry.ValidationState == ModelValidationState.Invalid)
        {
          <li>
            <strong>@key</strong>
            <ul>
              @foreach (var error in entry.Errors)
              {
                <li>@error.ErrorMessage</li>
              }
            </ul>
          </li>
        }
      }
    </ul>
  }
  else
  {
    <h3>Errors</h3>
  }
</body>
</html>
